﻿<%@ Page Title="" Language="C#" MasterPageFile="~/pages/master/WebList.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="BF.Web.pages.XZCF_WS_AJSLJLPage.List" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceJs" runat="server">
    <script type="text/javascript">
        function addTabIn(tabPanel, id, url, helpPanel) {
            var tab = tabPanel.getComponent(id);

            if (!tab) {
                tab = tabPanel.add({
                    id: id,
                    title: id,
                    closable: true,
                    autoLoad: {
                        showMask: true,
                        url: url,
                        mode: 'iframe',
                        maskMsg: '数据处理中，请稍候... '
                    }
                });
                tabPanel.setActiveTab(tab);
            }
            else {
                tabPanel.setActiveTab(tab);
            }
        }

        //删除
        var titleDelete = "提示";
        var msgDelete = "请选择要删除的记录！";
        var configDelete = "是否确认要删除记录！";
        function Delete() {
            var isDelete = $(":checkbox:checked");
            if (isDelete.length == 0) {
                Ext.MessageBox.show({ title: titleDelete, msg: msgDelete, buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            Ext.MessageBox.show({
                title: titleDelete,
                msg: configDelete,
                buttons: { yes: '确  定', no: '取 消' },
                fn: function (result) {
                    if (result == "yes") {
                        __doPostBack("ctl00$ContentPlaceHtml$btnDelete", "");
                    }
                },
                icon: 'ext-mb-info'
            });
            return false;
        }

        //弹出新增窗口
        function Add() {
            winer.OpenWin('新增', GetUrl(this) + 'Edit.aspx', 810, 550, false, this);
            return false;
        }

        //弹出查看窗口
        function View(sKey) {
            winer.OpenWin('查看', GetUrl(this) + 'Edit.aspx?State=View&sID=' + sKey, 775, 550, false, this);
            return false;
        }

        //修改前台方法
        function Update() {
            if ($(":checkbox:checked").length == 0) {
                Ext.MessageBox.show({ title: '提示', msg: '请选择要修改的记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            if ($(":checkbox:checked").length > 1) {//只能选择一项的判断
                Ext.MessageBox.show({ title: '提示', msg: '只能选择一条记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            var values = $(":checkbox:checked").val();

            winer.OpenWin('修改', GetUrl(this) + 'Edit.aspx?sID=' + values, 810, 550, false, this);

            return false;
        }

        //修改前台方法
        function Audit() {
            if ($(":checkbox:checked").length == 0) {
                Ext.MessageBox.show({ title: '提示', msg: '请选择要审核的记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            if ($(":checkbox:checked").length > 1) {//只能选择一项的判断
                Ext.MessageBox.show({ title: '提示', msg: '只能选择一条记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
        }

        //关闭弹出window时，执行的事件
        function Refurbish() {
            __doPostBack('ctl00$ContentPlaceHtml$AspNetPager1', '')
        }

        function MultipleSelect(obj) {
            if (obj.checked) {
                $("#div_scroll_x  :checkbox").attr("checked", true);
            }
            else {
                $("#div_scroll_x :checkbox:checked").each(function () {
                    $(this).attr("checked", false);
                })
            }
        }

        function checkStop(obj) {

            Controlcheck(obj);
        }

        //控制checkbox在单选模式时，只能单选
        function Controlcheck(obj) {
            if (!$("#chxIsMultipleSelect").attr("checked")) {
                if (obj.checked) {
                    $("#div_scroll_x  :checkbox:checked").not(obj).attr("checked", false);
                }
            }
        }

        function Print() {
            alert('打印成功！');
            return false;
        }

        function AJXQ() {
            if ($(":checkbox:checked").length == 0) {
                Ext.MessageBox.show({ title: '提示', msg: '请选择要查看的记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            if ($(":checkbox:checked").length > 1) {//只能选择一项的判断
                Ext.MessageBox.show({ title: '提示', msg: '只能选择一条记录！', buttons: { ok: '确  定' }, icon: 'ext-mb-info' });
                return false;
            }
            var values = $(":checkbox:checked").val();
            addTabIn(parent.Pages, '案件详情', GetUrl(this) + 'ViewList.aspx?sID=' + values, '');
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHtml" runat="server">
    <table id="tabHead" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
        class="listtop1">
        <tr>
            <td id="QueryCondition" style="border-bottom: 1px solid #8db2e3;">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-bottom: 5px; margin-top: 4px;"
                    class="content04 ">
                    <tr>
                        <td align="right">
                            案件来源：
                        </td>
                        <td>
                            <tll:DataTextBox ID="sAJLY" runat="server"
                                Width="138px" MaxLength="50"></tll:DataTextBox>
                        </td>
                        <td align="right">
                            案发单位：
                        </td>
                        <td>
                            <tll:DataTextBox ID="sAFDW" runat="server" Width="138px" MaxLength="50">
                            </tll:DataTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            受理时间：
                        </td>
                        <td>
                            <tll:DataTextBox ID="dSLSJBegin" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>/
                            <tll:DataTextBox ID="dSJSJEnd" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>
                        </td>
                        <td align="right">
                            经办时间：
                        </td>
                        <td>
                            <tll:DataTextBox ID="dJBSJBegin" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>/
                            <tll:DataTextBox ID="dJBSJEnd" runat="server" onclick="WdatePicker()" Width="65px"></tll:DataTextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table id="" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
                    style="margin-bottom: 2px; margin-top: 2px; height: 26px;">
                    <tr>
                        <td>
                            <div class="btn01">
                                <asp:LinkButton ID="btnQuery" runat="server" OnClientClick="" OnClick="btnQuery_Click">
                            <span>
                                <img alt="" src="http://extjs.com/s.gif" border="0" class="icon icon-magnifier" /><div class="center">
                                    查询</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnAdd" runat="server" OnClientClick="return Add();">
                            <span>
                                <img src="../../../images/table_add.png" alt="" border="0" /><div class="center">
                                    新增</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnUpdate" OnClientClick="return Update();" runat="server">
                                 <span>
                                <img src="../../../images/table_edit.png" alt="" border="0" /><div class="center">
                                    修改</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnDelete" runat="server" OnClientClick="return Delete();" OnClick="btnDelete_Click">
                            <span>
                                <img src="../../../images/table_delete.png" alt="" border="0" /><div class="center" id="divStop">
                                    删除</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnPrint" runat="server" OnClientClick="return Print();">
                            <span>
                                <img src="../../../images/printer.png" alt="" border="0" /><div class="center" id="divDetail">
                                    打印</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="btnAJXQ" runat="server" OnClientClick="return AJXQ();">
                            <span>
                                <img src="../../../images/printer.png" alt="" border="0" /><div class="center" id="div1">
                                    案件详情</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return Audit();" OnClick="LinkButton1_Click">
                            <span>
                                <img src="../../../images/printer.png" alt="" border="0" /><div class="center" id="div2">
                                    审核</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return Audit();" OnClick="LinkButton2_Click">
                            <span>
                                <img src="../../../images/printer.png" alt="" border="0" /><div class="center" id="div3">
                                    审核</div>
                            </span>
                                </asp:LinkButton>
                                <asp:LinkButton ID="LinkButton3" runat="server" OnClientClick="return Audit();" OnClick="LinkButton3_Click">
                            <span>
                                <img src="../../../images/printer.png" alt="" border="0" /><div class="center" id="div4">
                                    审核</div>
                            </span>
                                </asp:LinkButton>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div id="div_scroll_x" class="div_scroll">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Repeater ID="Repeater1" runat="server">
                    <HeaderTemplate>
                        <table id="tbList" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"
                            class="list">
                            <thead>
                                <tr>
                                    <td align="center" style="width: 32px; padding-left: 4px;">
                                        <input id="chxIsMultipleSelect" type="checkbox" value="title" onclick="MultipleSelect(this)" />
                                    </td>
                                    <td align="center" style="width: 150px;">
                                        案件来源
                                    </td>
                                    <td align="center" style="width: 150px;">
                                        案发单位
                                    </td>
                                    <td align="center" style="width: 100px;">
                                        受理时间
                                    </td>
                                    <td align="center" style="width: 150px;">
                                        案情摘要
                                    </td>
                                    <td align="center" style="width: 150px;">
                                        经办人签名
                                    </td>
                                    <td align="center" style="width: 100px;">
                                        经办时间
                                    </td>
                                    <td align="center" style="width: 150px;">
                                        案件状态
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td align="center">
                                <input type="checkbox" name="checkbox1" id="chksuserid" runat="server" value='<%#Eval("gKey")%>' onclick="checkStop(this)" />
                            </td>
                            <td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sAJLY")%>
                                </div>
                            </td>
                            <td align="left">
                                <div class="divnr-auto">
                                    <a href="#" onclick="View('<%#Eval("gKey")%>')">
                                        <%#Eval("sAFDW")%>
                                    </a>
                                </div>
                            </td>
                            <td align="center">
                                <div class="divnr-auto">
                                    <%#Eval("dSLSJ")==null?"":Eval("dSLSJ","{0:yyyy-MM-dd}")%>
                                </div>
                            </td>
                            <td align="left">
                                <div class="divnr-auto" title='<%#Eval("sAQZY")%>'>
                                    <%#Eval("sAQZY")%>
                                </div>
                            </td>
                            <td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("sJBRQM")%>
                                </div>
                            </td>
                            <td align="center">
                                <div class="divnr-auto">
                                    <%#Eval("dJBRQ")==null?"":Eval("dJBRQ","{0:yyyy-MM-dd}")%>
                                </div>
                            </td>
                            <td align="left">
                                <div class="divnr-auto">
                                    <%#Eval("iState")%>
                                </div>
                            </td>
                            <!--<td align="center">
                                <div class="divnr-auto" title='Eval("dPublishTime")==null?"":Eval("dPublishTime","{0:yyyy-MM-dd}")'>
                                    </div>
                            </td>-->
                            <td>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody></table>
                    </FooterTemplate>
                </asp:Repeater>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="AspNetPager1" EventName="PageChanged" />
                <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <div class="div_AspNetPager">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="fengye">
                    <tr>
                        <td>
                            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                                meta:resourcekey="AspNetPager1" PageSize="15">
                            </webdiyer:AspNetPager>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>

